package com.asit.demo.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author:huhy
 * @DATE:Created on 2018/1/3 12:47
 * @Modified By:
 * @Class 项目启动后运行此方法:CommandLineRunner实现
 */
@Component
@Order(value=2)
@Slf4j
public class ProjectInitRunner implements CommandLineRunner {
    @Resource
    private DynamicDatasource dynamicDatasource;

    @Override
    /**
     *@Author: huhy
     *@Package_name:com.huhy.web.common.runner
     *@Date:13:20 2018/1/3
     *@Description:项目启动后运行此方法 CommandLineRunner
     * //项目路径 path =  E:\IDE\workspace\ideaWorkspace\spring boot\spring-boot
    String path = System.getProperty("user.dir");
    CommandLine.main(new String[]{path+"\\src\\main\\resources\\ftpserver\\ftpd-typical.xml"});
    System.out.println("----------------------"+path);
     */
    public void run(String... var1) throws Exception {
        log.info("------------系统初始化方法------------");
        log.info("------------手动配置多数据源（关）------------");
        //dynamicDatasource.createNewDataSource();
    }
}